<template>
    <div>
        <!-- 面包屑 -->
        <el-bread></el-bread>
        <!-- 添加按钮 -->
        <el-button class="addbtn" type="primary" plain size="small" @click="add">添加</el-button>
        <!-- 表格 -->
        <Ulist @canedit="canedit"></Ulist>
        <!-- 弹框 -->
        <Udialog :UserInfo="UserInfo" @cancel="cancel" ref="DiaRef"></Udialog>

    </div>
</template>
<script>

import Ulist from './Ulist.vue'
import Udialog from './Udialog.vue'
export default {
    data() {
        return {
            UserInfo:{
                isShow:false,
                isAdd:true
            }
        }
    },
    methods: {
        // 点击添加显示弹框
        add(){
            // isShow 显示弹框   isAdd为true时是添加管理员
            this.UserInfo.isShow = true
            this.UserInfo.isAdd = true
        },
        cancel(e){
            this.UserInfo.isShow = e
        },
        canedit(uid){
            this.UserInfo.isShow = true
            this.UserInfo.isAdd = false
            this.$refs.DiaRef.lookup(uid)
        }
    },
    mounted() { },
    watch: {},
    computed: {},
    filters: {},
    components: {Ulist,Udialog}
}
</script>
<style scoped>
.addbtn {
    margin: 10px;
}
</style>